How to create/change Frantic JOB files (= FReditor data + binary data build with assembler)

=======================================================================================
Important: With FReditor you cannot edit meta-data and moving enemies. 
           This meta-data and moving enemies need to be build from a STAGE?.GEN file,
           see below for more info.
=======================================================================================
See also separate TXT file for info about the binary layout of the JOB file.
=======================================================================================


Suppose you want to change Job 3, then follow this workflow:
---------------------------------------------------------------------
-Start FReditor. Use this MSX disk: "FReditor (with Job data).dsk"

-Choose '3' when asked for stage nr. This results in Job 3 graphics being loaded for editing.

-Type 'ESC' followed by 'L' to load a JOB file. All files of current disk will be shown in text mode.
 Now enter 'STAGE3.JOB' followed by RETURN. This will load the design of Job 3.

-Navigate and change blocks (backgrounds, platforms, etc), see seperate TXT document for the manual.

-Use SELECT to show the address of each location. Write down the addresses where you want moving 
 enemies, like spiders, birds, etc. Also where you want moving platforms (start location / end location).

-Type 'ESC' followed by 'S' to save the changed JOB file. This JOB file does not contain meta-data and moving enemies.

-Now edit 'STAGE3.GEN'. Here you can edit:
 - Color palettes of Job 3 graphics.
 - Which music to start, and which to start at which elevator door.
 - Start position of Franc. (*)
 - X/Y position data of mouth animation (the guest you see after finishing the Job).
 - Text of earl Cramp you see before you start.
 - Conversation you see after finishing the job.
 - List of enemy data (5 bytes each). (*)
 - Closing bytes.
 (*) Focus on these if you only change the Job without changing graphics and texts.
 (for more info on STAGE?.GEN file, see below...)

-Build the changed 'STAGE3.GEN' (in MSX-DOS: A>GEN80 STAGE3.GEN ). This results in the output file 'STAGE3.COM'
 You can also use a binary editor like Frhed to create/edit 'STAGE3.COM'

-Finally, append the two files ('STAGE3.JOB' and 'STAGE3.COM') together. For example, in MSX-DOS, type:
 COPY STAGE3.JOB/B + STAGE3.COM/B FRANTIC3.JOB/B

-Now you have FRANTIC3.JOB which can be used with the original game. 
 It contains the all backgrounds (with platforms) as well as meta-data, moving enemies and moving platforms.
 

=========================================================================================================================
Extra info about 'STAGE?.GEN' files
=========================================================================================================================

All data has fixed lenghts, except for the list of enemies at the end. So keep the filling spaces where texts are defined.

All location addresses are 04000H lower than shown in FReditor. 
For example, when you see address '8052' in FReditor (use SELECT key), you need to edit:
DEFW 04052H    (or:  DEFB 052H,040H )
Such location adresses are used for Franc's start position and for the list of enemies/moving platforms.

Each enemy is described with 5 bytes:
-------------------------------------
- low-byte of location address
- high-byte of location address
- unique id of enemy
- enemy type (1,2,3,4,5,6 or 7)
- extra data (only used with enemy type 1,6,7: bird or moving platform)

List of enemy types:
--------------------
 1 = bird
 2 = yellow rat
 3 = kangaroo
 4 = spider
 5 = yellow digger
 6 = moving platform1 (not an enemy, never mind...)
 7 = moving platform2 (not an enemy, never mind...)

For example, the first 2 enemies of Job 3 (see 'STAGE3.GEN') are two 'yellow diggers':
--------------------------------------------------------------------------------------
  DEFB  064H,041H,1,5,0   - enemy 5 = yellow digger at location 04164H (in FReditor: 8164)
  DEFB  06AH,041H,2,5,0   - enemy 5 = yellow digger at location 0416AH (in FReditor: 816A)

The 5th byte (extra data) is only used for birds and moving platforms. 


For birds, the 5th byte describes the second low-byte, so that the bird can fly a horizontal line.
For example, the first bird of Job 3 is as follows:
 DEFB 04DH,042H,3,1,042H   - bird flies between 0424DH and 04242H (in FReditor: 824D-8242)


For moving platforms, the 5th byte describes:
---------------------------------------------
- amount of blocks to move (maximum: 63)
- whether platform moves vertically (add 64 if true)
- whether platform moves up OR left from here (add 128 if true)

Moving platform (horizontal), example:
----------------------------------------
 DEFB 0E2H,04CH,16,6,8    - platform starts at 04CE2H (in FReditor: 8CE2) and moves 8 blocks to the right.

Moving platform (vertical), example:
----------------------------------------
 DEFB  0ACH,046H,11,7,36+64      - starts at 046ACH, moves vertical (+64), moves 36 blocks DOWN from here
 DEFB  074H,047H,12,2,0          - an enemy between begin and end of moving platform
 DEFB  0C5H,047H,13,3,0          - an enemy between begin and end of moving platform
 DEFB  0ECH,048H,11,7,36+128+64  - starts at 048ECH, moves vertical (+64), moves 36 blocks UP (+128) from here
Note 1: The platforms at 046ACH and 048ECH are ONE AND THE SAME!! For technical reasons, only VERTICALLY 
        moving platforms need to be described twice (address top position and address bottom position).
        Also note that the Id is the same (is this example: 11), so it's ONE moving platform!
Note 2: The top and bottom positions (here 046ACH and 048ECH) are related like this:
        Top address + (16 * amount_of_moving) = Bottom address.  Example: 046ACH + (16 * 36) = 048ECH.
Note 3: No more than 2 moving platforms can be visible at one time. When 2 moving platforms need to be
        visible at one time, ensure to use enemy type 6 AND 7 (not 6 AND 6, not 7 AND 7).
        For other enemies (birds, spiders, etc) this constraint does not apply.


Finally:
--------
The list of enemies/platforms must always be ordered by the location address. 
See the example above:  046ACH -> 04774H -> 047C5H -> 048ECH ( = ordered from low to high).
(this is to assure that the right enemies/platforms appear while Franc moves up/down through the Job)

The last 5 bytes (000H,0C0H,236,0,0) are needed to prevent 'random' enemies at the bottom of the Job.


Missing data in 'STAGE5.GEN' and 'STAGES6.GEN'
----------------------------------------------
The enemy list in STAGES5.GEN and STAGES6.GEN is not complete. Probably the final version of these files 
are lost. The data can easily be reverse-engineered from the binaries 'FRANTIC5.JOB' and 'FRANTIC6.JOB'.








